package com.fand.platform.authority.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import lombok.val;

import org.apache.commons.lang3.StringUtils;

import com.fand.dto.PaginationDto;
import com.fand.persistent.builder.ModelArgs;
import com.fand.persistent.builder.ModelBuilder;
import com.fand.persistent.builder.ModelBuilderUtils;
import com.fand.persistent.support.DaoJdbcSupport;
import com.fand.platform.authority.dto.UserGrDto;
import com.fand.platform.authority.dto.UserGrLoDto;
import com.fand.platform.authority.dto.UserGrDeDto;
import com.fand.platform.authority.dto.UserGrDeLoDto;
import com.fand.platform.authority.dto.UserGrBuArDto;
import com.fand.platform.authority.dto.UserGrBuArLoDto;
import com.fand.platform.authority.dto.UserGrRoDto;
import com.fand.platform.authority.dto.UserGrRoLoDto;
import com.fand.platform.authority.dto.UserGrUsDto;
import com.fand.platform.authority.dto.UserGrUsLoDto;

/**
 * 用户组
 *
 * @author yaoHT
 * 
 */
public class UserGrJdbcDao extends DaoJdbcSupport implements UserGrDao {

	@Override
	public int insertUserGrBy1(UserGrDto insertUserGr, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGr, insertProperties));
		return this.update("authority/userGr/insertUserGrBy1", modelBuilder.build());
	}

	@Override
	public int insertUserGrBy1_1(UserGrDto insertUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGr));
				
		return this.update("authority/userGr/insertUserGrBy1", modelBuilder.build());
	}

	@Override
	public int insertUserGrBy2(UserGrDto insertUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGr));

		return this.update("authority/userGr/insertUserGrBy2", modelBuilder.build());
	}

	@Override
	public int deleteUserGrBy1(UserGrDto deleteUserGr, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGr,
				whereEqProperties));

		return this.update("authority/userGr/deleteUserGrBy1", modelBuilder.build());
	}
	@Override
	public int deleteUserGrBy1_1(UserGrDto deleteUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGr));

		return this.update("authority/userGr/deleteUserGrBy1", modelBuilder.build());
	}
	
	@Override
	public int deleteUserGrByIds(UserGrDto deleteUserGr) {
		val model = new HashMap<String, Object>();

		model.put("IDS", deleteUserGr.getIds());

		return this.update("authority/userGr/deleteUserGrByIds", model);
	}

	@Override
	public int updateUserGrBy1(UserGrDto updateUserGr, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGr, updateProperties), new ModelArgs(updateUserGr, whereEqProperties));

		return this.update("authority/userGr/updateUserGrBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrBy1_1(UserGrDto updateUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateUserGr));

		return this.update("authority/userGr/updateUserGrBy1", modelBuilder.build());
	}
	
	@Override
	public int updateUserGrBy2(UserGrDto updateUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateUserGr));

		return this.update("authority/userGr/updateUserGrBy2", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBy1ForObject(Class<R> requiredType, UserGrDto selectUserGr, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGr/selectUserGrBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBy1_1ForObject(Class<R> requiredType, UserGrDto selectUserGr, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr));

		return this.selectForObject(requiredType, "authority/userGr/selectUserGrBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBy2ForObject(Class<R> requiredType, UserGrDto selectUserGr, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr));

		return this.selectForObject(requiredType, "authority/userGr/selectUserGrBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBy1ForObjectList(Class<R> requiredType, UserGrDto selectUserGr, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGr/selectUserGrBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBy1_1ForObjectList(Class<R> requiredType, UserGrDto selectUserGr, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr));

		return this.selectForObjectList(requiredType, "authority/userGr/selectUserGrBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBy2ForObjectList(Class<R> requiredType, UserGrDto selectUserGr, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr));

		return this.selectForObjectList(requiredType, "authority/userGr/selectUserGrBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBy1ForMappedObject(Class<R> mappedClass, UserGrDto selectUserGr,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGr/selectUserGrBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBy1_1ForMappedObject(Class<R> mappedClass, UserGrDto selectUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr));

		return this.selectForMappedObject(mappedClass, "authority/userGr/selectUserGrBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBy2ForMappedObject(Class<R> mappedClass, UserGrDto selectUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr));

		return this.selectForMappedObject(mappedClass, "authority/userGr/selectUserGrBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int selectUserGrByCodeNqIdForInteger(UserGrDto selectUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder();

//		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder().putExtend(null, "code", null,
//				selectUserGr.getCode());

//		if (StringUtils.isNotBlank(selectUserGr.getId())) {
//			modelBuilder.putExtend(ModelBuilder.WHERE__AND__NQ, "id", null, selectUserGr.getId());
//		}

		return this.selectForObject(Integer.class, "authority/userGr/selectUserGrBy1ForObject", null,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBy1ForMappedObjectList(Class<R> mappedClass, UserGrDto selectUserGr,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGr/selectUserGrBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBy1_1ForMappedObjectList(Class<R> mappedClass, UserGrDto selectUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr));

		return this.selectForMappedObjectList(mappedClass, "authority/userGr/selectUserGrBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBy2ForMappedObjectList(Class<R> mappedClass, UserGrDto selectUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGr));

		return this.selectForMappedObjectList(mappedClass, "authority/userGr/selectUserGrBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> PaginationDto<R> paginationUserGrBy1ForMappedObjectList(Class<R> mappedClass,
				UserGrDto paginationUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationUserGr));

		return this.paginationForMappedObjectList(mappedClass, "authority/userGr/selectUserGrBy1ForObject",
				"authority/userGr/selectUserGrBy1ForMappedObjectList",
				paginationUserGr.getPaginationNo(),
				paginationUserGr.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public PaginationDto<Map<String, Object>> paginationUserGrBy1ForMapList(UserGrDto paginationUserGr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationUserGr));

		return this.paginationForMapList("authority/userGr/selectUserGrBy1ForObject",
				"authority/userGr/selectUserGrBy1ForMappedObjectList",
				paginationUserGr.getPaginationNo(),
				paginationUserGr.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public int insertUserGrLoBy1(UserGrLoDto insertUserGrLo, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrLo, insertProperties));
		return this.update("authority/userGrLo/insertUserGrLoBy1", modelBuilder.build());
	}

	@Override
	public int deleteUserGrLoBy1(UserGrLoDto deleteUserGrLo, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrLo,
				whereEqProperties));

		return this.update("authority/userGrLo/deleteUserGrLoBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrLoBy1(UserGrLoDto updateUserGrLo, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGrLo, updateProperties), new ModelArgs(updateUserGrLo, whereEqProperties));

		return this.update("authority/userGrLo/updateUserGrLoBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrLoBy1ForObject(Class<R> requiredType, UserGrLoDto selectUserGrLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrLo,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGrLo/selectUserGrLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrLoBy1ForObjectList(Class<R> requiredType, UserGrLoDto selectUserGrLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrLo,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGrLo/selectUserGrLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrLoBy1ForMappedObject(Class<R> mappedClass, UserGrLoDto selectUserGrLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGrLo/selectUserGrLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrLoBy1ForMappedObjectList(Class<R> mappedClass, UserGrLoDto selectUserGrLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGrLo/selectUserGrLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int insertUserGrDeBy1(UserGrDeDto insertUserGrDe, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrDe, insertProperties));
		return this.update("authority/userGrDe/insertUserGrDeBy1", modelBuilder.build());
	}

	@Override
	public int deleteUserGrDeBy1(UserGrDeDto deleteUserGrDe, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrDe,
				whereEqProperties));

		return this.update("authority/userGrDe/deleteUserGrDeBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrDeBy1(UserGrDeDto updateUserGrDe, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGrDe, updateProperties), new ModelArgs(updateUserGrDe, whereEqProperties));

		return this.update("authority/userGrDe/updateUserGrDeBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrDeBy1ForObject(Class<R> requiredType, UserGrDeDto selectUserGrDe, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrDe,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGrDe/selectUserGrDeBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrDeBy1ForObjectList(Class<R> requiredType, UserGrDeDto selectUserGrDe, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrDe,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGrDe/selectUserGrDeBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrDeBy1ForMappedObject(Class<R> mappedClass, UserGrDeDto selectUserGrDe,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrDe,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGrDe/selectUserGrDeBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrDeBy1ForMappedObjectList(Class<R> mappedClass, UserGrDeDto selectUserGrDe,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrDe,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGrDe/selectUserGrDeBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int insertUserGrDeLoBy1(UserGrDeLoDto insertUserGrDeLo, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrDeLo, insertProperties));
		return this.update("authority/userGrDeLo/insertUserGrDeLoBy1", modelBuilder.build());
	}

	@Override
	public int deleteUserGrDeLoBy1(UserGrDeLoDto deleteUserGrDeLo, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrDeLo,
				whereEqProperties));

		return this.update("authority/userGrDeLo/deleteUserGrDeLoBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrDeLoBy1(UserGrDeLoDto updateUserGrDeLo, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGrDeLo, updateProperties), new ModelArgs(updateUserGrDeLo, whereEqProperties));

		return this.update("authority/userGrDeLo/updateUserGrDeLoBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrDeLoBy1ForObject(Class<R> requiredType, UserGrDeLoDto selectUserGrDeLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrDeLo,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGrDeLo/selectUserGrDeLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrDeLoBy1ForObjectList(Class<R> requiredType, UserGrDeLoDto selectUserGrDeLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrDeLo,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGrDeLo/selectUserGrDeLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrDeLoBy1ForMappedObject(Class<R> mappedClass, UserGrDeLoDto selectUserGrDeLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrDeLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGrDeLo/selectUserGrDeLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrDeLoBy1ForMappedObjectList(Class<R> mappedClass, UserGrDeLoDto selectUserGrDeLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrDeLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGrDeLo/selectUserGrDeLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int insertUserGrBuArBy1(UserGrBuArDto insertUserGrBuAr, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrBuAr, insertProperties));
		return this.update("authority/userGrBuAr/insertUserGrBuArBy1", modelBuilder.build());
	}

	@Override
	public int insertUserGrBuArBy1_1(UserGrBuArDto insertUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrBuAr));
				
		return this.update("authority/userGrBuAr/insertUserGrBuArBy1", modelBuilder.build());
	}

	@Override
	public int insertUserGrBuArBy2(UserGrBuArDto insertUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrBuAr));

		return this.update("authority/userGrBuAr/insertUserGrBuArBy2", modelBuilder.build());
	}

	@Override
	public int deleteUserGrBuArBy1(UserGrBuArDto deleteUserGrBuAr, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrBuAr,
				whereEqProperties));

		return this.update("authority/userGrBuAr/deleteUserGrBuArBy1", modelBuilder.build());
	}
	@Override
	public int deleteUserGrBuArBy1_1(UserGrBuArDto deleteUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrBuAr));

		return this.update("authority/userGrBuAr/deleteUserGrBuArBy1", modelBuilder.build());
	}
	
	@Override
	public int deleteUserGrBuArByIds(UserGrBuArDto deleteUserGrBuAr) {
		val model = new HashMap<String, Object>();

		model.put("IDS", deleteUserGrBuAr.getIds());

		return this.update("authority/userGrBuAr/deleteUserGrBuArByIds", model);
	}

	@Override
	public int updateUserGrBuArBy1(UserGrBuArDto updateUserGrBuAr, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGrBuAr, updateProperties), new ModelArgs(updateUserGrBuAr, whereEqProperties));

		return this.update("authority/userGrBuAr/updateUserGrBuArBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrBuArBy1_1(UserGrBuArDto updateUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateUserGrBuAr));

		return this.update("authority/userGrBuAr/updateUserGrBuArBy1", modelBuilder.build());
	}
	
	@Override
	public int updateUserGrBuArBy2(UserGrBuArDto updateUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateUserGrBuAr));

		return this.update("authority/userGrBuAr/updateUserGrBuArBy2", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBuArBy1ForObject(Class<R> requiredType, UserGrBuArDto selectUserGrBuAr, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGrBuAr/selectUserGrBuArBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBuArBy1_1ForObject(Class<R> requiredType, UserGrBuArDto selectUserGrBuAr, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr));

		return this.selectForObject(requiredType, "authority/userGrBuAr/selectUserGrBuArBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBuArBy2ForObject(Class<R> requiredType, UserGrBuArDto selectUserGrBuAr, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr));

		return this.selectForObject(requiredType, "authority/userGrBuAr/selectUserGrBuArBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBuArBy1ForObjectList(Class<R> requiredType, UserGrBuArDto selectUserGrBuAr, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGrBuAr/selectUserGrBuArBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBuArBy1_1ForObjectList(Class<R> requiredType, UserGrBuArDto selectUserGrBuAr, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr));

		return this.selectForObjectList(requiredType, "authority/userGrBuAr/selectUserGrBuArBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBuArBy2ForObjectList(Class<R> requiredType, UserGrBuArDto selectUserGrBuAr, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr));

		return this.selectForObjectList(requiredType, "authority/userGrBuAr/selectUserGrBuArBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBuArBy1ForMappedObject(Class<R> mappedClass, UserGrBuArDto selectUserGrBuAr,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGrBuAr/selectUserGrBuArBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBuArBy1_1ForMappedObject(Class<R> mappedClass, UserGrBuArDto selectUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr));

		return this.selectForMappedObject(mappedClass, "authority/userGrBuAr/selectUserGrBuArBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBuArBy2ForMappedObject(Class<R> mappedClass, UserGrBuArDto selectUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr));

		return this.selectForMappedObject(mappedClass, "authority/userGrBuAr/selectUserGrBuArBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int selectUserGrBuArByCodeNqIdForInteger(UserGrBuArDto selectUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder();

//		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder().putExtend(null, "code", null,
//				selectUserGrBuAr.getCode());

//		if (StringUtils.isNotBlank(selectUserGrBuAr.getId())) {
//			modelBuilder.putExtend(ModelBuilder.WHERE__AND__NQ, "id", null, selectUserGrBuAr.getId());
//		}

		return this.selectForObject(Integer.class, "authority/userGrBuAr/selectUserGrBuArBy1ForObject", null,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBuArBy1ForMappedObjectList(Class<R> mappedClass, UserGrBuArDto selectUserGrBuAr,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGrBuAr/selectUserGrBuArBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBuArBy1_1ForMappedObjectList(Class<R> mappedClass, UserGrBuArDto selectUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr));

		return this.selectForMappedObjectList(mappedClass, "authority/userGrBuAr/selectUserGrBuArBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBuArBy2ForMappedObjectList(Class<R> mappedClass, UserGrBuArDto selectUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuAr));

		return this.selectForMappedObjectList(mappedClass, "authority/userGrBuAr/selectUserGrBuArBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> PaginationDto<R> paginationUserGrBuArBy1ForMappedObjectList(Class<R> mappedClass,
				UserGrBuArDto paginationUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationUserGrBuAr));

		return this.paginationForMappedObjectList(mappedClass, "authority/userGrBuAr/selectUserGrBuArBy1ForObject",
				"authority/userGrBuAr/selectUserGrBuArBy1ForMappedObjectList",
				paginationUserGrBuAr.getPaginationNo(),
				paginationUserGrBuAr.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public PaginationDto<Map<String, Object>> paginationUserGrBuArBy1ForMapList(UserGrBuArDto paginationUserGrBuAr) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationUserGrBuAr));

		return this.paginationForMapList("authority/userGrBuAr/selectUserGrBuArBy1ForObject",
				"authority/userGrBuAr/selectUserGrBuArBy1ForMappedObjectList",
				paginationUserGrBuAr.getPaginationNo(),
				paginationUserGrBuAr.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public int insertUserGrBuArLoBy1(UserGrBuArLoDto insertUserGrBuArLo, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrBuArLo, insertProperties));
		return this.update("authority/userGrBuArLo/insertUserGrBuArLoBy1", modelBuilder.build());
	}

	@Override
	public int deleteUserGrBuArLoBy1(UserGrBuArLoDto deleteUserGrBuArLo, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrBuArLo,
				whereEqProperties));

		return this.update("authority/userGrBuArLo/deleteUserGrBuArLoBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrBuArLoBy1(UserGrBuArLoDto updateUserGrBuArLo, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGrBuArLo, updateProperties), new ModelArgs(updateUserGrBuArLo, whereEqProperties));

		return this.update("authority/userGrBuArLo/updateUserGrBuArLoBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBuArLoBy1ForObject(Class<R> requiredType, UserGrBuArLoDto selectUserGrBuArLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuArLo,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGrBuArLo/selectUserGrBuArLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBuArLoBy1ForObjectList(Class<R> requiredType, UserGrBuArLoDto selectUserGrBuArLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuArLo,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGrBuArLo/selectUserGrBuArLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrBuArLoBy1ForMappedObject(Class<R> mappedClass, UserGrBuArLoDto selectUserGrBuArLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuArLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGrBuArLo/selectUserGrBuArLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrBuArLoBy1ForMappedObjectList(Class<R> mappedClass, UserGrBuArLoDto selectUserGrBuArLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrBuArLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGrBuArLo/selectUserGrBuArLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int insertUserGrRoBy1(UserGrRoDto insertUserGrRo, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrRo, insertProperties));
		return this.update("authority/userGrRo/insertUserGrRoBy1", modelBuilder.build());
	}

	@Override
	public int insertUserGrRoBy1_1(UserGrRoDto insertUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrRo));
				
		return this.update("authority/userGrRo/insertUserGrRoBy1", modelBuilder.build());
	}

	@Override
	public int insertUserGrRoBy2(UserGrRoDto insertUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrRo));

		return this.update("authority/userGrRo/insertUserGrRoBy2", modelBuilder.build());
	}

	@Override
	public int deleteUserGrRoBy1(UserGrRoDto deleteUserGrRo, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrRo,
				whereEqProperties));

		return this.update("authority/userGrRo/deleteUserGrRoBy1", modelBuilder.build());
	}
	@Override
	public int deleteUserGrRoBy1_1(UserGrRoDto deleteUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrRo));

		return this.update("authority/userGrRo/deleteUserGrRoBy1", modelBuilder.build());
	}
	
	@Override
	public int deleteUserGrRoByIds(UserGrRoDto deleteUserGrRo) {
		val model = new HashMap<String, Object>();

		model.put("IDS", deleteUserGrRo.getIds());

		return this.update("authority/userGrRo/deleteUserGrRoByIds", model);
	}

	@Override
	public int updateUserGrRoBy1(UserGrRoDto updateUserGrRo, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGrRo, updateProperties), new ModelArgs(updateUserGrRo, whereEqProperties));

		return this.update("authority/userGrRo/updateUserGrRoBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrRoBy1_1(UserGrRoDto updateUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateUserGrRo));

		return this.update("authority/userGrRo/updateUserGrRoBy1", modelBuilder.build());
	}
	
	@Override
	public int updateUserGrRoBy2(UserGrRoDto updateUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateUserGrRo));

		return this.update("authority/userGrRo/updateUserGrRoBy2", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrRoBy1ForObject(Class<R> requiredType, UserGrRoDto selectUserGrRo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGrRo/selectUserGrRoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrRoBy1_1ForObject(Class<R> requiredType, UserGrRoDto selectUserGrRo, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo));

		return this.selectForObject(requiredType, "authority/userGrRo/selectUserGrRoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrRoBy2ForObject(Class<R> requiredType, UserGrRoDto selectUserGrRo, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo));

		return this.selectForObject(requiredType, "authority/userGrRo/selectUserGrRoBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrRoBy1ForObjectList(Class<R> requiredType, UserGrRoDto selectUserGrRo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGrRo/selectUserGrRoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrRoBy1_1ForObjectList(Class<R> requiredType, UserGrRoDto selectUserGrRo, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo));

		return this.selectForObjectList(requiredType, "authority/userGrRo/selectUserGrRoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrRoBy2ForObjectList(Class<R> requiredType, UserGrRoDto selectUserGrRo, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo));

		return this.selectForObjectList(requiredType, "authority/userGrRo/selectUserGrRoBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrRoBy1ForMappedObject(Class<R> mappedClass, UserGrRoDto selectUserGrRo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGrRo/selectUserGrRoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrRoBy1_1ForMappedObject(Class<R> mappedClass, UserGrRoDto selectUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo));

		return this.selectForMappedObject(mappedClass, "authority/userGrRo/selectUserGrRoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrRoBy2ForMappedObject(Class<R> mappedClass, UserGrRoDto selectUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo));

		return this.selectForMappedObject(mappedClass, "authority/userGrRo/selectUserGrRoBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int selectUserGrRoByCodeNqIdForInteger(UserGrRoDto selectUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder();

//		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder().putExtend(null, "code", null,
//				selectUserGrRo.getCode());

//		if (StringUtils.isNotBlank(selectUserGrRo.getId())) {
//			modelBuilder.putExtend(ModelBuilder.WHERE__AND__NQ, "id", null, selectUserGrRo.getId());
//		}

		return this.selectForObject(Integer.class, "authority/userGrRo/selectUserGrRoBy1ForObject", null,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrRoBy1ForMappedObjectList(Class<R> mappedClass, UserGrRoDto selectUserGrRo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGrRo/selectUserGrRoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrRoBy1_1ForMappedObjectList(Class<R> mappedClass, UserGrRoDto selectUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo));

		return this.selectForMappedObjectList(mappedClass, "authority/userGrRo/selectUserGrRoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrRoBy2ForMappedObjectList(Class<R> mappedClass, UserGrRoDto selectUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRo));

		return this.selectForMappedObjectList(mappedClass, "authority/userGrRo/selectUserGrRoBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> PaginationDto<R> paginationUserGrRoBy1ForMappedObjectList(Class<R> mappedClass,
				UserGrRoDto paginationUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationUserGrRo));

		return this.paginationForMappedObjectList(mappedClass, "authority/userGrRo/selectUserGrRoBy1ForObject",
				"authority/userGrRo/selectUserGrRoBy1ForMappedObjectList",
				paginationUserGrRo.getPaginationNo(),
				paginationUserGrRo.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public PaginationDto<Map<String, Object>> paginationUserGrRoBy1ForMapList(UserGrRoDto paginationUserGrRo) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationUserGrRo));

		return this.paginationForMapList("authority/userGrRo/selectUserGrRoBy1ForObject",
				"authority/userGrRo/selectUserGrRoBy1ForMappedObjectList",
				paginationUserGrRo.getPaginationNo(),
				paginationUserGrRo.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public int insertUserGrRoLoBy1(UserGrRoLoDto insertUserGrRoLo, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrRoLo, insertProperties));
		return this.update("authority/userGrRoLo/insertUserGrRoLoBy1", modelBuilder.build());
	}

	@Override
	public int deleteUserGrRoLoBy1(UserGrRoLoDto deleteUserGrRoLo, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrRoLo,
				whereEqProperties));

		return this.update("authority/userGrRoLo/deleteUserGrRoLoBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrRoLoBy1(UserGrRoLoDto updateUserGrRoLo, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGrRoLo, updateProperties), new ModelArgs(updateUserGrRoLo, whereEqProperties));

		return this.update("authority/userGrRoLo/updateUserGrRoLoBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrRoLoBy1ForObject(Class<R> requiredType, UserGrRoLoDto selectUserGrRoLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRoLo,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGrRoLo/selectUserGrRoLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrRoLoBy1ForObjectList(Class<R> requiredType, UserGrRoLoDto selectUserGrRoLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRoLo,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGrRoLo/selectUserGrRoLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrRoLoBy1ForMappedObject(Class<R> mappedClass, UserGrRoLoDto selectUserGrRoLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRoLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGrRoLo/selectUserGrRoLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrRoLoBy1ForMappedObjectList(Class<R> mappedClass, UserGrRoLoDto selectUserGrRoLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrRoLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGrRoLo/selectUserGrRoLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int insertUserGrUsBy1(UserGrUsDto insertUserGrUs, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrUs, insertProperties));
		return this.update("authority/userGrUs/insertUserGrUsBy1", modelBuilder.build());
	}

	@Override
	public int insertUserGrUsBy1_1(UserGrUsDto insertUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrUs));
				
		return this.update("authority/userGrUs/insertUserGrUsBy1", modelBuilder.build());
	}

	@Override
	public int insertUserGrUsBy2(UserGrUsDto insertUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrUs));

		return this.update("authority/userGrUs/insertUserGrUsBy2", modelBuilder.build());
	}

	@Override
	public int deleteUserGrUsBy1(UserGrUsDto deleteUserGrUs, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrUs,
				whereEqProperties));

		return this.update("authority/userGrUs/deleteUserGrUsBy1", modelBuilder.build());
	}
	@Override
	public int deleteUserGrUsBy1_1(UserGrUsDto deleteUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrUs));

		return this.update("authority/userGrUs/deleteUserGrUsBy1", modelBuilder.build());
	}
	
	@Override
	public int deleteUserGrUsByIds(UserGrUsDto deleteUserGrUs) {
		val model = new HashMap<String, Object>();

		model.put("IDS", deleteUserGrUs.getIds());

		return this.update("authority/userGrUs/deleteUserGrUsByIds", model);
	}

	@Override
	public int updateUserGrUsBy1(UserGrUsDto updateUserGrUs, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGrUs, updateProperties), new ModelArgs(updateUserGrUs, whereEqProperties));

		return this.update("authority/userGrUs/updateUserGrUsBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrUsBy1_1(UserGrUsDto updateUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateUserGrUs));

		return this.update("authority/userGrUs/updateUserGrUsBy1", modelBuilder.build());
	}
	
	@Override
	public int updateUserGrUsBy2(UserGrUsDto updateUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(updateUserGrUs));

		return this.update("authority/userGrUs/updateUserGrUsBy2", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrUsBy1ForObject(Class<R> requiredType, UserGrUsDto selectUserGrUs, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGrUs/selectUserGrUsBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrUsBy1_1ForObject(Class<R> requiredType, UserGrUsDto selectUserGrUs, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs));

		return this.selectForObject(requiredType, "authority/userGrUs/selectUserGrUsBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrUsBy2ForObject(Class<R> requiredType, UserGrUsDto selectUserGrUs, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs));

		return this.selectForObject(requiredType, "authority/userGrUs/selectUserGrUsBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrUsBy1ForObjectList(Class<R> requiredType, UserGrUsDto selectUserGrUs, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGrUs/selectUserGrUsBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrUsBy1_1ForObjectList(Class<R> requiredType, UserGrUsDto selectUserGrUs, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs));

		return this.selectForObjectList(requiredType, "authority/userGrUs/selectUserGrUsBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrUsBy2ForObjectList(Class<R> requiredType, UserGrUsDto selectUserGrUs, String objectId) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs));

		return this.selectForObjectList(requiredType, "authority/userGrUs/selectUserGrUsBy2ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrUsBy1ForMappedObject(Class<R> mappedClass, UserGrUsDto selectUserGrUs,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGrUs/selectUserGrUsBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrUsBy1_1ForMappedObject(Class<R> mappedClass, UserGrUsDto selectUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs));

		return this.selectForMappedObject(mappedClass, "authority/userGrUs/selectUserGrUsBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrUsBy2ForMappedObject(Class<R> mappedClass, UserGrUsDto selectUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs));

		return this.selectForMappedObject(mappedClass, "authority/userGrUs/selectUserGrUsBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public int selectUserGrUsByCodeNqIdForInteger(UserGrUsDto selectUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder();

//		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder().putExtend(null, "code", null,
//				selectUserGrUs.getCode());

//		if (StringUtils.isNotBlank(selectUserGrUs.getId())) {
//			modelBuilder.putExtend(ModelBuilder.WHERE__AND__NQ, "id", null, selectUserGrUs.getId());
//		}

		return this.selectForObject(Integer.class, "authority/userGrUs/selectUserGrUsBy1ForObject", null,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrUsBy1ForMappedObjectList(Class<R> mappedClass, UserGrUsDto selectUserGrUs,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGrUs/selectUserGrUsBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrUsBy1_1ForMappedObjectList(Class<R> mappedClass, UserGrUsDto selectUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs));

		return this.selectForMappedObjectList(mappedClass, "authority/userGrUs/selectUserGrUsBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrUsBy2ForMappedObjectList(Class<R> mappedClass, UserGrUsDto selectUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUs));

		return this.selectForMappedObjectList(mappedClass, "authority/userGrUs/selectUserGrUsBy2ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> PaginationDto<R> paginationUserGrUsBy1ForMappedObjectList(Class<R> mappedClass,
				UserGrUsDto paginationUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationUserGrUs));

		return this.paginationForMappedObjectList(mappedClass, "authority/userGrUs/selectUserGrUsBy1ForObject",
				"authority/userGrUs/selectUserGrUsBy1ForMappedObjectList",
				paginationUserGrUs.getPaginationNo(),
				paginationUserGrUs.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public PaginationDto<Map<String, Object>> paginationUserGrUsBy1ForMapList(UserGrUsDto paginationUserGrUs) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(paginationUserGrUs));

		return this.paginationForMapList("authority/userGrUs/selectUserGrUsBy1ForObject",
				"authority/userGrUs/selectUserGrUsBy1ForMappedObjectList",
				paginationUserGrUs.getPaginationNo(),
				paginationUserGrUs.getPaginationSize(),
				modelBuilder.build());
	}

	@Override
	public int insertUserGrUsLoBy1(UserGrUsLoDto insertUserGrUsLo, String... insertProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.INSERT,
				insertUserGrUsLo, insertProperties));
		return this.update("authority/userGrUsLo/insertUserGrUsLoBy1", modelBuilder.build());
	}

	@Override
	public int deleteUserGrUsLoBy1(UserGrUsLoDto deleteUserGrUsLo, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(deleteUserGrUsLo,
				whereEqProperties));

		return this.update("authority/userGrUsLo/deleteUserGrUsLoBy1", modelBuilder.build());
	}

	@Override
	public int updateUserGrUsLoBy1(UserGrUsLoDto updateUserGrUsLo, String[] updateProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(ModelBuilder.UPDATE,
				updateUserGrUsLo, updateProperties), new ModelArgs(updateUserGrUsLo, whereEqProperties));

		return this.update("authority/userGrUsLo/updateUserGrUsLoBy1", modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrUsLoBy1ForObject(Class<R> requiredType, UserGrUsLoDto selectUserGrUsLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUsLo,
				whereEqProperties));

		return this.selectForObject(requiredType, "authority/userGrUsLo/selectUserGrUsLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrUsLoBy1ForObjectList(Class<R> requiredType, UserGrUsLoDto selectUserGrUsLo, String objectId,
			String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUsLo,
				whereEqProperties));

		return this.selectForObjectList(requiredType, "authority/userGrUsLo/selectUserGrUsLoBy1ForObject", objectId,
				modelBuilder.build());
	}

	@Override
	public <R> R selectUserGrUsLoBy1ForMappedObject(Class<R> mappedClass, UserGrUsLoDto selectUserGrUsLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUsLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObject(mappedClass, "authority/userGrUsLo/selectUserGrUsLoBy1ForMappedObjectList",
				modelBuilder.build());
	}

	@Override
	public <R> List<R> selectUserGrUsLoBy1ForMappedObjectList(Class<R> mappedClass, UserGrUsLoDto selectUserGrUsLo,
			String[] selectProperties, String... whereEqProperties) {
		final ModelBuilder modelBuilder = ModelBuilderUtils.newModelBuilder(new ModelArgs(selectUserGrUsLo,
				whereEqProperties));

		modelBuilder.putTrueExtend(ModelBuilder.SELECT, selectProperties);

		return this.selectForMappedObjectList(mappedClass, "authority/userGrUsLo/selectUserGrUsLoBy1ForMappedObjectList",
				modelBuilder.build());
	}
}